|
|
|
|
|
|
|
7. To insert another blank item before the Exit menu item, select the Exit item and then click Insert. |
|
|
|
|
|
|
|
|
8. Enter a hyphen as the new item's Caption property and mnuHyphen2 as its Name property. |
|
|
|
|
|
|
|
|
9. Click OK to close the Menu Editor. |
|
|
|
|
|
|
|
|
Figure 6.6 depicts the Menu Editor after creating and modifying the sample File menu. |
|
|
|
|
|
|
|
|
Figure 6.6
Multiple menu levels help
organize your program's functions. |
|
|
|
|
|
|
|
|
Adding Access Keys and Shortcut Keys for Quick Access |
|
|
|
|
|
|
|
|
Many menu items in Windows programs can be accessed by using keystroke combinations. You can let users access your menu items in the same way. Two types of key combinations can be used this way: access keys and shortcut keys. |
|
|
|
|
|
|
|
|
Access keys offer users a way to navigate a menu system by using the keyboard instead of a mouse. If a menu item has an access key defined, the access key is indicated by an underscore beneath the letter in the item's caption (for example, the F in File). You create an access key by placing an ampersand (&) in front of the appropriate letter in the Caption property. For the File menu, the Caption property would be &File. You can create an access key for any or all of the items in your menu. |
|
|
|
|
| |
|
|
|
|
Where possible, use the first letter of the menu item as the access key, because typically the users expect it. On the other hand, you shouldn't use the first letter if that letter is already in use in that menu. For example, Visual Basic's Format menu uses the second letter as the access key to avoid conflict with the File menu. You can assign the same access key to multiple menu items. If you do so, Visual Basic just cycles through the items with each press of the access key. However, this approach is not standard practice because having to press an access key multiple times defeats its purpose. In addition, many users don't know that they can cycle through the items in this manner and become frustrated when they see no apparent way to select the desired choice. |
|
|
|
|
|
|
|